	function getCardLevel(url,customerId,selectObj,db_level){
		$.ajax({cache:false, 
		url:url, 
		type:"post", 
		dataType:"json", 
		success:function(json){updateCardLevel(json,selectObj,db_level);}});
	}

	function getCardAgio(url,customerId,selectObj,db_agio){
		$.ajax({cache:false, 
		url:url, 
		type:"post", 
		dataType:"json", 
		success:function(json){updateCardAgio(json,selectObj,db_agio);}});
	}
	
	function updateCardLevel(json,selectObj,db_level){
		initCardLevelAndAgioOption(selectObj);
		for(var i in json){
			var option = document.createElement("option");
			var value = json[i].id;
			var text = json[i].levelName;
			if(value==db_level){
				option.selected=true;
			}
			option.text = text;
			option.value = value;
			selectObj.options[selectObj.options.length] = option;
		}
	}
	function updateCardAgio(json,selectObj,db_agio){
		initCardLevelAndAgioOption(selectObj);
		for(var i in json){
			var option = document.createElement("option");
			var value = json[i].id;
			var text = json[i].name;
			if(value==db_agio){
				option.selected=true;
			}
			option.text = text;
			option.value = value;
			selectObj.options[selectObj.options.length] = option;
		}
	}
	function initCardLevelAndAgioOption(obj){
		obj.options.length = 0;
		var firstOption = document.createElement("option");
		firstOption.text="请选择";
		firstOption.value="-1";
		obj.options[obj.options.length] = firstOption;
	}
	//日期比较 from开始日期 to结束日期
	function checkDate(fromId,toId){
		var from = $("#"+fromId).val();
		var to = $("#"+toId).val();
		if (from==""||to=="")
			return true;
		from = parseInt(from.replaceAll("-",""));
		to = parseInt(to.replaceAll("-",""));
		if (from>=to) {
			alertMsg.error("结束日期不能小于开始日期！");
			return false;
		}
		return true;
	}
	//检查日期不能小于当前日期
	function checkCurrentDate(dateId){
		var date = $("#"+dateId).val();
		if(date=="")return true;
		date = parseInt(date.replaceAll("-",""));
		var today = parseInt(getToday().replaceAll("-",""));
		if (date < today) {
			alertMsg.error("选择的日期不能小于当前日期！");
			return false;
		}
		return true;
	}
	function getToday(){
		var today = new Date();
		var dateStr = today.getYear();
		if (dateStr<1900)
			dateStr=1900+dateStr;
		var temp = today.getMonth()+1;
		if (temp<10)
			temp = "0"+temp;
		dateStr += "-"+temp;
		temp = today.getDate();
		if (temp<10)
			temp = "0"+temp;
		dateStr += "-"+temp;
		return dateStr;
	}
	//检查是否是正确数字并返回转换后的数字
	function checkNum(val){
		if(val=="")return "";
		if (isNaN(val)){return "";}
		while(val.indexOf("0")==0)val=val.substring(1);
		if(val=="")return "";
		return parseInt(val);
	}